import React,{useEffect,useState} from 'react'
import {history} from 'umi'
import notImg from '../static/image/4044.gif'

export default function notFound() {
    let [count,setCount]=useState(5)
    let [timer,setStimer]=useState(5)
    useEffect(()=>{
        const timer=setInterval(() => {
            setCount(count--)
        },1000);
        setStimer(timer)
    },[])
    useEffect(() => {
        if(count==1){
            clearInterval(timer)
            history.replace('/home')
        }
    }, [count])
    return (
        <div style={{overflow:'hidden',height:'100vh'}}>
            <img src={notImg} alt="" style={{width:"100%",height:'100%'}}/>
            <h1 style={{position:'fixed',top:'100px',left:'150px'}}>{count}秒后返回首页</h1>
        </div>
    )
}
